﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using WeifenLuo.WinFormsUI.Docking;

using DependencyInjection;
using PolarExpress.View.Interfaces;

namespace PolarExpress.View
{
    public partial class FrmMainView : Form, IMainView
    {
        IErrorView _vError;

        IEventView _vEvent;

        IExplorerView _vExplorer;

        IOutputView _vOutput;

        IPlayView _vPlay;

        IPropertyView _vProperty;

        ISceneView _vScene;

        IToolboxView _vToolbox;

        IWarningView _vWarning;

        [Inject]
        public FrmMainView(
            IErrorView vError,
            IEventView vEvent,
            IExplorerView vExplorer,
            IOutputView vOutput,
            IPlayView vPlay,
            IPropertyView vProperty,
            ISceneView vScene,
            IToolboxView vToolbox,
            IWarningView vWarning)

        {
            InitializeComponent();

            _vError = vError;
            _vEvent = vEvent;
            _vExplorer = vExplorer;
            _vOutput = vOutput;
            _vPlay = vPlay;
            _vProperty = vProperty;
            _vScene = vScene;
            _vToolbox = vToolbox;
            _vWarning = vWarning;

            Show(_vError);
            Show(_vEvent);
            Show(_vExplorer);
            Show(_vOutput);
            Show(_vPlay);
            Show(_vProperty);
            Show(_vScene);
            Show(_vToolbox);
            Show(_vWarning);
        }

        public FrmMainView()
        {
            InitializeComponent();
        }

        public void Show(IView view)
        {
            if (view is DockContent)
            {
                ((DockContent)view).Show(dockPanel1);
            }
        }

        private void FrmMainView_Load(object sender, EventArgs e)
        {

        }

        private void tsbUndo_Click(object sender, EventArgs e)
        {

        }

        private void tsbRedo_Click(object sender, EventArgs e)
        {

        }

        private void tsbSelect_Click(object sender, EventArgs e)
        {

        }

        private void tsbMove_Click(object sender, EventArgs e)
        {

        }

        private void tsbRotate_Click(object sender, EventArgs e)
        {

        }

        private void tsbScale_Click(object sender, EventArgs e)
        {

        }

        private void tsMode_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            ToolStripButton btn = e.ClickedItem as ToolStripButton;

            foreach (ToolStripButton b in tsMode.Items)
            {
                b.Checked = false;
            }

            btn.Checked = true;
        }
    }
}
